﻿using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace MyAnimelistRecommender.Converter
{
    public class SortingStateToFontWeightConverter : IValueConverter
    {
        public object Convert(object value, Type targetType,
            object parameter, CultureInfo culture)
        {
            string svalue = (value as string);
            if (svalue == "All" && App.Model.SelectedSortingMode == "Recommends")
                return FontWeights.Bold;
            else if (svalue == "Scored" && App.Model.SelectedSortingMode == "Scored Recommends")
                return FontWeights.Bold;
            else if (svalue == "Sources" && App.Model.SelectedSortingMode == "Sources")
                return FontWeights.Bold;

            else return FontWeights.Normal;
        }

        public object ConvertBack(object value, Type targetType,
            object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}